#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int findPeakElement(int arr[], int sz)
{
	if (arr[0] > arr[1])
		return 0;
	if (arr[sz - 1] > arr[sz - 2])
		return sz - 1;
	for (int i = 1; i < sz - 1; i++)
	{
		if (arr[i] > arr[i - 1] && arr[i] > arr[i + 1])
			return i;
	}
}
int main()
{
	int n = 0;
	int arr[7] = { 0 };
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &arr[i]);
	}
	printf("%d", findPeakElement(arr, n));
	return 0;
}













